package com.example.eliliya.simple_play1;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;

/**
 * Created by EliLiya on 2018/5/30.
 */

public class Music extends Service{
    private MediaPlayer player;
    public IBinder onBind(Intent intent){
        return null;
    }
    public void onStart(Intent intent,int startId){
        super.onStart(intent,startId);
        player=MediaPlayer.create(this,R.raw.gequ);
        player.start();
    }
    public void onDestroy(){
        super.onDestroy();
        player.stop();
    }
}
